package pyrachnid.model.ground_model;

import pyrachnid.model.Observable;

public class Fire extends Observable implements Cloneable {
	private int _fireIntensity;
	
	public Fire(int fireIntensity) {
		_fireIntensity = fireIntensity;
	}
	
	@Override
	public Fire clone() throws CloneNotSupportedException {
		return (Fire) super.clone();
	}

	public int getFireIntensity() {
		return _fireIntensity;
	}
	
	public void incressIntensity(int value) {
		if (_fireIntensity < 100) {
			_fireIntensity += value;
			
			if(_fireIntensity > 100)
			{
				_fireIntensity = 100;
			}
			
			notifyObserver(this, "FireIntensity");
		}
	}

	public void decressIntensity(int value) {
		if (_fireIntensity > 0) {
			_fireIntensity -= value;
			
			if(_fireIntensity < 0)
			{
				_fireIntensity = 0;
			}
			
			notifyObserver(this, "FireIntensity");
		}
	}
}